      PROGRAM FLOW
      INCLUDE 'params.h'
      INCLUDE 'lunits.h'               
      INCLUDE 'jobcom.h'
      INCLUDE 'trecom.h'
      CHARACTER*80 CLINE
      LOUT = 6
      LINTRE = 50
      LOUTCO = 60
      LOUTRE = 61
      LOUTCH = 96
      LQERY = .FALSE.
      LEXT = .FALSE.                               
      LCHRT = .FALSE.
      LTREE = .FALSE.
      LCOMM = .FALSE.
      READ(1,'(A)',END=999,ERR=999) CLINE
      IF(INDEX(CLINE,'query').NE.0) LQERY = .TRUE.
      IF(INDEX(CLINE,'externals').NE.0) LEXT = .TRUE.
      IF(INDEX(CLINE,'graphics').NE.0) LCHRT = .TRUE.
      IF(INDEX(CLINE,'chart').NE.0) LTREE = .TRUE.
      IF(INDEX(CLINE,'common').NE.0) LCOMM = .TRUE.
      IF(INDEX(CLINE,'node').NE.0) THEN
         CLINE = CLINE(INDEX(CLINE,'node')+5:)
         CTREE = CLINE(:INDEX(CLINE,' ')-1)
      ENDIF
      CALL PRODES
      STOP
  999 WRITE(LOUT,'(A)') ' FLOW: Error reading control file.'
      STOP 1
      END
